from pypinyin import pinyin, Style


def convert_to_pinyin(name):
    """
    将汉字转换为拼音
    :param name: 汉字字符串
    :return: 拼音字符串
    """
    pinyin_list = pinyin(name, style=Style.NORMAL)
    pinyin_string = "".join([item[0] for item in pinyin_list])
    print([item[0] for item in pinyin_list])
    return pinyin_string


if __name__ == '__main__':
    name = "黄世"
    pinyin_name = convert_to_pinyin(name)
    print(pinyin_name)
